package com.hliushi.learn.dao;

import com.hliushi.learn.bean.BookLend;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Mapper
@Repository
public interface BookLendMapper {
    int deleteByPrimaryKey(Long sernum);

    int insert(BookLend record);

    int insertSelective(BookLend record);

    BookLend selectByPrimaryKey(Long sernum);

    int updateByPrimaryKeySelective(BookLend record);

    int updateByPrimaryKey(BookLend record);

    List<BookLend> selectByAll(BookLend bookLend);

    List<BookLend> find();

    List<BookLend> findBySernumGreaterThanAndLendDate(@Param("minSernum") Long minSernum,
                                                      @Param("lendDate") Date lendDate);

    BookLend findOneByBookId(@Param("bookId") Long bookId);


    BookLend findOneBySernum(@Param("sernum") Long sernum);

    BookLend findFirstBySernumGreaterThan(@Param("minSernum") Long minSernum);

    Integer countByLendDate(@Param("lendDate") Date lendDate);


}